/*************************************************************************
 *
 * $Id: serial_hnds.h 119 2007-01-22 17:35:57Z Ales $
 * 
 *************************************************************************/         

#ifndef _SERIAL_HNDS_H
#define _SERIAL_HNDS_H

extern void STDATA_R_Handler(PACKET_HEADER *ph, char *data, unsigned char length);
extern void RWDATA_W_Handler(PACKET_HEADER *ph, char *data, unsigned char length);
extern void RWDATA_R_Handler(PACKET_HEADER *ph, char *data, unsigned char length);
extern void INIT_R_Handler(PACKET_HEADER *ph, char *data, unsigned char length);
extern void LOG_R_Handler(PACKET_HEADER *ph, char *data, unsigned char length);
extern void LOG_E_Handler(PACKET_HEADER *ph, char *data, unsigned char length);
extern void ONEWIRE_SCAN_Handler(PACKET_HEADER *ph, char *data, unsigned char length);
extern void DEBUG_Handler(PACKET_HEADER *ph, char *data, unsigned char length);

const SERIAL_HANDLER serial_handler[] PROGMEM = {
    /*  CMD                 STATE_FUNC             */
    {   CMD_STDATA_READ,    STDATA_R_Handler        },
    {   CMD_RWDATA_WRITE,   RWDATA_W_Handler        },
    {   CMD_RWDATA_READ,    RWDATA_R_Handler        },
    {   CMD_INIT_READ,      INIT_R_Handler          },
    {   CMD_LOG_READ,       LOG_R_Handler           },
    {   CMD_LOG_ERASE,      LOG_E_Handler           },
    {   CMD_ONEWIRE_SCAN,   ONEWIRE_SCAN_Handler    },
    {   CMD_DEBUG,          DEBUG_Handler           },
    {   0,                  0,                      }
};

#endif
